package com.xm_jd.controller.dd;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xm_jd.model.dao.index6Dao;
import com.xm_jd.model.entitys.tb_sh;
import com.xm_jd.utils.BaseServlet;

/**
 * Servlet implementation class index6
 */
@WebServlet("/index6")
public class index6 extends BaseServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public index6() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
				//查询收货地址
				request.setCharacterEncoding("utf-8");
				
				request.getSession().getAttribute("user");
				
				List<tb_sh> list = new index6Dao().selectSh(1);
				request.getSession().setAttribute("address", list);
				//request.getRequestDispatcher("jsps/dd/dd_index6.jsp").forward(request, response);
				this.forward("dd/dd_index6");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
